import Vue from 'vue'

export const eventBus=new Vue();

import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

//百度地图引入
import BaiduMap from 'vue-baidu-map'
Vue.use(BaiduMap, {ak: 'u0lRNVjX88MnnuuhQ4R1uNWHc5Dj7gmE'})


//引入wangEditor
import wangEditor from "wangeditor"
// 给Vue添加一个全局属性，之后可以通过this.$wangEditor访问到此属性
Vue.prototype.wangEditor = wangEditor

//引入ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
Vue.config.productionTip = false

//引入qs框架
import qs from 'qs'
Vue.prototype.qs=qs;

//Axios
import axios from 'axios'
Vue.prototype.axios=axios;


//重写方法解决跳转到同一路由报错问题
    const myReplace = router.replace;
router.replace = function replace(location) {
  return myReplace.call(this,location).catch(err=>err);
};

const myPush = router.push;
router.push = function push(location) {
  return myPush.call(this,location).catch(err=>err);
};


Vue.config.productionTip = false



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
